package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class LambdaDemo01 {
    public static void main(String[] args) {
        Point p1 = new Point(10,20);
        Point p2 = new Point(5,30);
        List<Point> list = new ArrayList<>();
        list.add(p1);
        list.add(p2);

        Collections.sort(list,(o1, o2) -> o1.getX()- o2.getX());

    }
}
